package com.doctcloud.hisinfo.histable.domain.outpbill;

import com.baomidou.mybatisplus.annotation.TableName;
import com.doctcloud.common.core.annotation.Excel;
import com.doctcloud.common.core.annotation.NotZero;
import com.doctcloud.common.core.utils.StringUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import javax.validation.constraints.NotBlank;
import java.util.Date;

import static com.doctcloud.common.core.utils.StringUtils.trim;

/**
 * @ClassName 门诊收费主记录
 * @Author samula
 * @Descripe product by com.doctcloud
 * @Data 2025-09-23 2:43
 **/
//@TableName("outp_rcpt_master")
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = {"rcptNo"})
@ToString
public class OutpRcptMasterDo {
    private static final long serialVersionUID = 1L;
    @Excel(name = "单据号")
    @NotBlank(message = "单据号不得为空")
    private String rcptNo;
    @Excel(name = "患者ID")
    @NotBlank(message = "患者ID不得为空")
    private String patientId;
    @Excel(name = "患者姓名")
    @NotBlank(message = "患者姓名不得为空")
    private String name;
    @Excel(name = "患者拼音码")
    private String namePhonetic;
    @Excel(name = "患者身份")
    private String identity;
    @Excel(name = "患者费别")
    private String chargeType;
    @Excel(name = "合同单位")
    private String unitInContract;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "就诊日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date visitDate;
    @Excel(name = "收费标记" , readConverterExp = "0-正常交费,1-欠费,2-已退费")
    private Integer chargeIndicator;
    @Excel(name = "计价总费")
    @NotZero(message = "计价总费用不得为NULL或零")
    private Double totalCosts;
    @Excel(name = "应收总费")
    private Double totalCharges;
    @Excel(name = "操作员号")
    private String operatorNo;
    @Excel(name = "对应退费单据号")
    private String refundedRcptNo;
    @Excel(name = "结账单号")
    private String acctNo;
    @Data
    public static class primaryKey {
        private final String rcptNo;
        public primaryKey(String rcptNo) {
            this.rcptNo = rcptNo;
        }
    }
    public void setPatientId(String patientId) {
        this.patientId = trim(patientId);
    }

    public void setName(String name) {
        this.name = trim(name);
    }

    public void setNamePhonetic(String namePhonetic) {
        this.namePhonetic = trim(namePhonetic);
    }

    public void setIdentity(String identity) {
        this.identity = trim(identity);
    }

    public void setChargeType(String chargeType) {
        this.chargeType = trim(chargeType);
    }

}
